#!/bin/bash
export IFS=$'\n'
cp $2/confs/$3/$1 $4/$1
for i in `cat $2/$3.dict`; do
OLD=`echo $i | awk --field-separator \| '{print $1}'`
NEW=`echo $i | awk --field-separator \| '{print $2}'`
sed 's/'${OLD}'/'${NEW}'/g' $4/$1 > $4/$1_tmp

mv $4/$1_tmp $4/$1
done
mv $4/$1 $2/confs/$3/$1.final
exit;